#ifndef QS_BLE_PROTOCOL_H_
#define QS_BLE_PROTOCOL_H_
#pragma pack(1)
typedef union {
    struct {
        uint8_t len;
        uint8_t type;
        uint8_t data[1];
    };
    struct {
        uint8_t len;
        uint8_t type;
        uint32_t value;
    }keys;
    struct {
        uint8_t len;
        uint8_t type;
        uint16_t code;
        uint16_t param;
        uint16_t param1;
        uint16_t param2;
    }cmd;
    struct {
        uint8_t len;
        uint8_t type;
      
        uint8_t auto_mode;
        uint8_t work_mode;
        uint8_t fan_level;
        uint8_t heat_level;
      
        int8_t ntc_temp;
        uint8_t temp0;
        uint8_t humid0;
        uint8_t temp1;
        uint8_t humid1;
        uint16_t timer;
    }status;
    uint8_t daten[1];
}qs_ble_protocol_t;
#pragma pack()

typedef void (*qs_ble_protocol_on_rx_cmd_handle_s)(uint16_t cmd, uint16_t value,uint16_t value1,uint16_t value2);
typedef void (*qs_ble_protocol_on_rx_key_handle_s)(void);


void qs_ble_protocol_data_send(qs_ble_protocol_t* p_frame, uint8_t size);

uint32_t qs_ble_keys_result_get(void);
void qs_ble_protocol_init();
void qs_ble_protocol_data_process(void);
void qs_ble_protocol_on_rx_key_handle_set(qs_ble_protocol_on_rx_key_handle_s on_rx_key_handle);
void qs_ble_protocol_on_rx_cmd_handle_set(qs_ble_protocol_on_rx_cmd_handle_s on_rx_cmd_handle);

#endif